def scrt():
    path: str = '/bin'
    import os
    files = os.listdir(path)
    content = list(map(lambda s: s + '@@\n', files))
    with open('/home/xieweig/document/m.txt', 'w+') as m:
        m.writelines(content)


import numpy as np


def t1():
    # pass
    q = np.arange(15)
    w = np.where(np.logical_and(q > 5, q < 10))
    print(repr(w), type(w[0]), w, q[w])


def t2():
    a = np.arange(2, 10).reshape(2, 4)
    b = np.arange(10, 22).reshape(3, 4)
    b=np.arange(10,22).reshape(4,3)
    print(a, b)
    w = np.concatenate((a, b), axis=0)
    print(w, type(w))
    k= np.sum(w,axis=1)
    print(k,type(k),k.shape)
    print(k.T,k.T.shape)


def t3():
    a=np.arange(20).reshape(4,5)
    b=np.arange(2,42,2).reshape(4,5)
    print(a,b,sep='\n')
    print(a+b,a-b,a*b,sep='\n')
    print(np.dot(a,b.T))


def t4():
    a=np.arange(25.0).reshape(5,5)
    b=np.arange(2,42,2).reshape(4,5)
    c=np.eye(5)
    print(a,c,sep='\n')
    # m=np.matrix(a)
    # d=np.linalg.inv(m)

    d=np.linalg.det(a)

    print(d)


if __name__ == '__main__':
    # from some import r2
    # test02()
    t4()
